package com.stellar.circle.controller.admin.sCommentLike;

import com.stellar.circle.controller.admin.sCommentLike.vo.SCommentLikeRequestPageVO;
import com.stellar.circle.controller.admin.sCommentLike.vo.SCommentLikeRequestVO;
import com.stellar.circle.controller.admin.sCommentLike.vo.SCommentLikeResponseVO;
import com.stellar.circle.domain.sCommentLike.SCommentLikeDomainService;

import com.stellar.web.core.bean.PageResult;
import com.stellar.web.core.bean.Result;
import com.stellar.web.core.validator.ValidatorRole;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 评论点赞表控制器
 * @author Jqchan
 * @version 1.0
 * @date 2025-05-19 14:53:10
 */
@RequestMapping("/api-admin/sCommentLike")
@RestController("adminSCommentLikeController")
@Slf4j
public class SCommentLikeController {

    @Resource
    private SCommentLikeDomainService sCommentLikeDomainService;

    /**
     * 分页查询评论点赞表
     */
    @ValidatorRole
    @PostMapping("/page")
    public Result<PageResult<SCommentLikeResponseVO>> page(@RequestBody SCommentLikeRequestPageVO requestPageVO) {
        return Result.success(sCommentLikeDomainService.page(requestPageVO));
    }

    /**
     * 新增评论点赞表
     */
    @ValidatorRole
    @PostMapping("/create")
    public Result<Boolean> create(@RequestBody SCommentLikeRequestVO requestVO) {
        return Result.success(sCommentLikeDomainService.insert(requestVO));
    }

    /**
     * 修改评论点赞表
     */
    @PostMapping("/update")
    public Result<Boolean> update(@RequestBody SCommentLikeRequestVO requestVO) {
        return Result.success(sCommentLikeDomainService.update(requestVO));
    }

    /**
     * 删除评论点赞表
     */
    @ValidatorRole
    @DeleteMapping("/delete/{id}")
    public Result<Boolean> delete(@PathVariable("id") Long id) {
        return Result.success(sCommentLikeDomainService.delete(id));
    }

    /**
     * 获取评论点赞表详情
     */
    @ValidatorRole
    @GetMapping("/get/{id}")
    public Result<SCommentLikeResponseVO> get(@PathVariable("id") Long id) {
        return Result.success(sCommentLikeDomainService.get(id));
    }
}
